﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PortalLogingManager.ascx.cs" Inherits="NCS.Portal.Administrator.Portals.PortalLogingManager" %>
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Label ID="lblUpdateStatus" runat="server"></asp:Label>
<table border="0" cellpadding="2" cellspacing="2" style="width: 100%">
    <tr>
        <td>
            <strong>Tìm:</strong>
            <asp:TextBox ID="txtKeyword" runat="server" Width="231px"></asp:TextBox>
            <strong>Theo:</strong>
            <asp:DropDownList ID="dropSearchBy" runat="server" Width="188px">
                <asp:ListItem Text="Tất cả" Value=""></asp:ListItem>
                <asp:ListItem Text="Người Dùng" Value="Date"></asp:ListItem>
                <asp:ListItem Text="Module" Value="ModuleName"></asp:ListItem>
                <asp:ListItem Text="Nội dung" Value="Log_Content"></asp:ListItem>
            </asp:DropDownList>
            <asp:Button ID="btnSearch" runat="server" CssClass="Button" OnClick="btnSearch_Click"
                Text="Tìm kiếm" /></td>
    </tr>
    <tr>
        <td>
            <asp:UpdatePanel ID="upanelGridUserManagemt" runat="server" RenderMode="Inline" UpdateMode="Conditional">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="btnDeleteSelected" EventName="Click" />
                </Triggers>
                <ContentTemplate>
                    <asp:GridView ID="dtgUsers" runat="server" AllowPaging="true" AllowSorting="True"
                        AutoGenerateColumns="False" BorderColor="Gainsboro" BorderStyle="solid" BorderWidth="1px"
                        CellPadding="2" CssClass="Grid" OnPageIndexChanging="dtgUsers_PageIndexChanging"
                        OnPreRender="dtgUsers_PreRender" OnSorting="dtgUsers_Sorting"
                        PageSize="20" Width="100%">
                        <AlternatingRowStyle CssClass="Grid_Raw2" />
                        <RowStyle CssClass="Grid_Raw1" />
                        <HeaderStyle CssClass="Grid_Top" Font-Bold="True" />
                        <Columns>
                            <asp:BoundField DataField="Actor" HeaderText="T&#234;n truy cập" SortExpression="Actor" />
                            <asp:BoundField DataField="Date" HeaderText="Ngày tháng" SortExpression="Date" />
                            <asp:BoundField DataField="ModuleName" HeaderText="Module" SortExpression="ModuleName" />
                            <asp:TemplateField HeaderText="Mô tả">
                                <ItemStyle HorizontalAlign="Justify" />
                                <ItemTemplate>
                                    <%# Eval("Log_Content") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerTemplate>
                            <table id="tbPager" width="100%">
                                <tr>
                                    <td>
                                        Page
                                        <asp:DropDownList ID="ddlNumberPages" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlNumberPages_SelectedIndexChanged">
                                        </asp:DropDownList>
                                        of
                                        <asp:Label ID="lbTotalPages" runat="server"></asp:Label></td>
                                    <td>
                                        <asp:DropDownList ID="ddlPageItems" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPageItems_SelectedIndexChanged">
                                            <asp:ListItem>5</asp:ListItem>
                                            <asp:ListItem Selected="True">10</asp:ListItem>
                                            <asp:ListItem>20</asp:ListItem>
                                        </asp:DropDownList></td>
                                    <td align="right">
                                        <asp:LinkButton ID="lbtnFirst" runat="server" CausesValidation="false" CommandArgument="First"
                                            CommandName="Page" Text="<<"></asp:LinkButton>&nbsp;
                                        <asp:LinkButton ID="lbtnPrev" runat="server" CausesValidation="false" CommandArgument="Prev"
                                            CommandName="Page" Text="Prev"></asp:LinkButton>&nbsp;
                                        <asp:LinkButton ID="lbtnNext" runat="server" CausesValidation="false" CommandArgument="Next"
                                            CommandName="Page" Text="Next"></asp:LinkButton>&nbsp;
                                        <asp:LinkButton ID="lbtnLast" runat="server" CausesValidation="false" CommandArgument="Last"
                                            CommandName="Page" Text=">>"></asp:LinkButton></td>
                                </tr>
                            </table>
                        </PagerTemplate>
                        <EmptyDataTemplate>
                            There was no data to return
                        </EmptyDataTemplate>
                        <PagerSettings Mode="NumericFirstLast" />
                    </asp:GridView>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
    <tr>
        <td style="height: 28px">
            <asp:Button ID="btnDeleteSelected" runat="server" CssClass="Button" OnClick="btnDeleteSelected_Click"
                OnClientClick="return confirmMsg(this.form)" Text="Xóa Log" />
            <asp:Button ID="btnAddUser" runat="server" CssClass="Button" OnClick="btnAddUser_Click"
                Text="Xuất Log ra file Text" />
        </td>
    </tr>
</table>
